#!/usr/bin/env python
# -*- coding: utf-8 -*-
from StringIO import StringIO
from core.ide.commandmanager import CommandManager
from extensions.langs.auto import Extend as AutoLang
from core.ide.datamangager import DataMangager, DataInfos



class Extend():
    def __init__(self):
        self.name = "Actionscript"
        self.setSettings()
        
    def setSettings(self):
        data = DataMangager().getData(self.name,"Flex SDK","")
        data.type = DataInfos.DIR
        data = DataMangager().getData(self.name,"target version","11.0")
        data.type = DataInfos.FLOAT

    def getTemplates(self):
        return ["actionscript/templates/class.as"]

    def run(self):
        pass
    
    def getStyles(self):
        style={
            0:"fore:#999900",
            1:"fore:#666666", 
            2:"fore:#006600", #Comment
            3:"fore:#006600", #Block Comment
            4:"fore:#4040EF", #Number
            5:"fore:#0000cc", 
            6:"fore:#990000", # "[...]"
            7:"fore:#990000",# '[...]'
            8:"fore:#009090", #Class name
            9:"fore:#009090",  #def name
            10:"fore:#000000", #{}=+
            11:"fore:#000000", #Default text   
            12:"fore:fore:#990000", #"
            13:"fore:#990099",
            14:"fore:#c1670d", #stc.STC_P_WORD2
            13:"fore:#0099FF",
            15:"fore:#006600", #@modifier
            16:"fore:#009090", #object
            17:"fore:#006600,bold", #CommentDocKeyword
            18:"fore:#660000", #CommentDocKeywordError
            19:"fore:#99FF99", #Comment
            35:"back:#FFD9D9",#bad Brace
            34:"back:#D9D9FF",#Brace
        }
        return style
    
    def getLexer(self):
        return 3
    
    def _genConfig(self):
        return ""
    
    def getConfigPanel(self):
        return []
    
    def read(self,text,path):
        pass
    
    def getSourceFileNames(self): 
        return ["*.as"]
    
    def getMode(self):
        return ["Release", "Debug"]
    
    def getKeyWord(self):
        keywords={}
        keywords[0]=["this","for","if","while","break","case","const","var","else","switch",
                     "case","break","continue","trace","new","import","this","class","function",
                     "private","protected","public","static","package","override","set","get","extends"]
        keywords[1]=["int","uint","Boolean","void","Number String"]
        return keywords
    
